package com.yongz.vo;

import lombok.Data;

import java.io.Serializable;

@Data
public class JsonResult implements Serializable {

    private String code;
    private String msg;
    private String data;

    public JsonResult(String number, String msg, Object o) {
        this.code = number;
        this.msg = msg;
        this.data = o.toString();
    }


    public static JsonResult fail(String msg) {
        return new JsonResult("500", msg, null);
    }

    public static JsonResult success(Object o) {

        return new JsonResult("200",null, o);
    }
}
